import http from '@/utils/httpRequest'
import {
	debug
} from 'util'
export default {

/** 商品分类列表  **/
  goodsCategoryList (param) {
    return http.get(http.adornUrl('goods/yjcategory/tree'))
  },
  goodsCategorySave (param) {
    return http.post(http.adornUrl('goods/yjcategory/save'), param)
  },
  goodsCategoryDelete (id) {
    return http.delete(http.adornUrl(`goods/yjcategory/delete/${id}`))
  },
  goodsCategoryInfo (id) {
    return http.get(http.adornUrl(`goods/yjcategory/info/${id}`))
  },
/** 商品列表  **/
  goodsList (param) {
    return http.get(http.adornUrl('goods/yjgoods/list'), {
      params: param
    })
  },
/** * 体验区列表 ***/
  experienceList (param) {
    return http.get(http.adornUrl('goods/yjgoods/displaylist'), {
      params: param
    })
  },
/** 体验区商品移除type **/
  delExperience (param) {
    return http.post(http.adornUrl(`goods/yjgoods/clearGoods`), param)
  },
  goodsSave (param) {
    return http.post(http.adornUrl('goods/yjgoods/save'), param)
  },
  goodsDelete (id) {
    return http.delete(http.adornUrl(`goods/yjgoods/delete/${id}`))
  },
  goodsInfo (id) {
    return http.get(http.adornUrl(`goods/yjgoods/info/${id}`))
  },

/** 单品规格新增 */
  goodsSkuSave (param) {
    return http.post(http.adornUrl(`goods/yjgoodssku/save`), param)
  },

/** 批量插入规格名及属性 */
  batchUpdate (param) {
    return http.post(http.adornUrl(`goods/yjspec/batchUpdate`))
  },
  getGoodsSku (id) {
    return http.get(http.adornUrl(`goods/yjgoods/getGoodsSku/${id}`))
  },
/** 品牌 */
  brandList (param) {
    return http.get(http.adornUrl(`goods/yjbrand/list`), {
      params: param
    })
  },
  brandSave (param) {
    return http.post(http.adornUrl('goods/yjbrand/save'), param)
  },
  brandUpdate (param) {
    return http.post(http.adornUrl('goods/yjbrand/update'), param)
  },
  brandDelete (id) {
    return http.delete(http.adornUrl(`goods/yjbrand/delete/${id}`))
  },
/** SKU */
  sukList (param) {
    return http.get(http.adornUrl(`goods/yjspec/list`), {
      params: param
    })
  },
  skuSave (param) {
    return http.post(http.adornUrl('goods/yjspec/save'), param)
  },
  skuUpdate (param) {
    return http.post(http.adornUrl('goods/yjspec/update'), param)
  },
  skuDelete (ids) {
    return http.post(http.adornUrl(`goods/yjspec/delete`), ids)
  },
  updateGoodsType (param) {
    return http.post(http.adornUrl('goods/yjgoods/updateGoodsType'), param)
  },
/** SKU带id列表 */
  sukListId () {
    return http.get(http.adornUrl(`goods/yjspec/skuList`))
  },
  yjspecSkuSave (param) {
    return http.post(http.adornUrl('goods/yjspec/skuSave'), param)
  },
/** 批量新增 */
  batchSave (param) {
    return http.post(http.adornUrl('goods/yjspec/batchSave'), param)
  },
/** 多规格sku详情 */
  skuGoodsInfo (param) {
    return http.get(http.adornUrl(`goods/yjspec/skuGoodsInfo/${param}`))
  },
/** 多规格商品详情 */
  getGoodsSku (param) {
    return http.get(http.adornUrl(`goods/yjgoodssku/getGoodsSku/${param}`))
  },
/** 供应商管理 */
  dealersListSelect (param) {
    return http.get(http.adornUrl(`dealers/list`), {
      params: param
    })
  },
  dealersSave (param) {
    return http.post(http.adornUrl('dealers/save'), param)
  },
  dealersDelete (id) {
    return http.delete(http.adornUrl(`dealers/delete/${id}`))
  },
/** 物流 */

  expressList (param) {
    return http.get(http.adornUrl(`express/list`), {
      params: param
    })
  },
  expressSave (param) {
    return http.post(http.adornUrl('express/save'), param)
  },
  expressDelete (id) {
    return http.delete(http.adornUrl(`express/delete/${id}`))
  },
  dealersList (id) {
    return http.get(http.adornUrl(`api/dealersList`))
  },

  setUserLev (param) {
    return http.post(http.adornUrl(`sys/user/setUserLev`), param)
  },

/** 商家商品分销查看 **/
  shopGetDistribute (id) {
    return http.get(http.adornUrl(`admin/distribution/goodsconfig/info/${id}`))
  },

/** 商家商品分销设置 **/
  shopSetDistribute (param) {
    return http.post(http.adornUrl('admin/distribution/goodsconfig/set'), param)
  },
/** 商家服务商品分销查看 **/
  servicegoodsconfig (id) {
    return http.get(http.adornUrl(`admin/distribution/servicegoodsconfig/info/${id}`))
  },

/** 商家服务商品分销设置 **/
  servicegoodsconfigSet (param) {
    return http.post(http.adornUrl('admin/distribution/servicegoodsconfig/set'), param)
  }
}
